/**
 * 拨打电话
 * @param { String } phoneNumber 电话号码
 */
export function makePhoneCall(phoneNumber) {
	console.log(phoneNumber);
	return new Promise(resolve => {
		if (isNaN(parseFloat(phoneNumber)) || !isFinite(phoneNumber)) {
			resolve({
				errno: 9999,
				errMsg: '参数类型不符合'
			})
			return
		}
		wx.makePhoneCall({
			phoneNumber: phoneNumber + '', //拨打所需的电话号码
			success: (res) => {
				console.log('调用成功', res);
				resolve(res.errMsg)
			},
			fail: (err) => {
				console.log('调用失败', err);
				wx.showToast({
					title: '拨打电话失败',
					icon: 'error'
				})
				resolve(err);
			}
		})
	})
}
